package com.gnerv.sylvanas.framework.core.exception;

import com.gnerv.sylvanas.framework.common.model.RestResult;
import com.gnerv.sylvanas.framework.core.tools.JsonTools;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 业务处理异常
 * </p>
 *
 * @author Gnerv LiGen
 */
@EqualsAndHashCode(callSuper = true)
@Data
public abstract class BaseException extends RuntimeException {

    private RestResult<Void> restResult;

    public BaseException(String message) {
        super(message);
    }

    public BaseException(RestResult<Void> restResult) {
        super(JsonTools.toJsonString(restResult));
        this.restResult = restResult;
    }

}
